/*
 * TMap Designer - A Thematic Map design software
 * Copyright (C) 2006 World Health Organization
 * http://www.who.int
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
package who.tmap.digitizer;

/**
 * 
 * @author mathieu bolletta
 * <BR>
 * This interface must be implemented by classes that belong to the IO package <BR>
 * <B><U>Responsibilities:</U></B><BR>
 * <UL>
 * <LI>Providing a start method that initialize and run the acquisition thread
 * <LI>Providing a getPoint method that gives the coordinates gathered from the peripheral (such as a point)
 * <LI>Providing a stop method that stop the thread started using the start() method
 * </UL>
 *
 */
public interface DigitizerService extends Runnable {
	
	/**
	 * Start the acquisition thread
	 */
	void start() throws Exception ;
	
	/**
	 * Stop the acquisition thread
	 */
	void stop();
	
	/** 
	 * @return if the relative coordinates system has been correctly configured
	 */	
	boolean relativeCoordinatesSystemIsConfigured();
	
	// Following methods belong to data acquisition actions
	
	void setXMin( double xMin );
	double getXMin();
	
	void setYMin( double yMin );
	double getYMin();
	
	void setXMax( double xMax );
	double getXMax();
	
	void setYMax( double yMax );
	double getYMax();
	
	void setCommunicationPort( String portName );
	String getCommunicationPort();
	
	void setDataBitsConfiguration( int dataBits );
	int getDataBitsConfiguration();
	
	void setParity( int parity );
	int getParity();
	
	void setBaudRate( int baudRate );
	int getBaudRate();
	
	void setStopBits( int stopBits );
	int getStopBits();
	
	String getFieldSeparator();
	void setFieldSeparator(String separator);
	
	String getLineSeparator();
	void setLineSeparator(String lineSeparator);

	String getNewPointButton();
	void setNewPointButton(String newPointButton);
	
	String getClosePolygonButton();
	void setClosePolygonButton(String closePolygonButton);

}
